import request from '@/utils/request'

// 查询拍卖列表
export function getAuctionList(query) {
  return request({
    url: '/merchant/auction/list',
    method: 'get',
    params: query
  })
}

// 查询拍卖详细
export function getAuctionDetail(id) {
  return request({
    url: '/merchant/auction/' + id,
    method: 'get'
  })
}

// 新增拍卖
export function addAuction(data) {
  return request({
    url: '/merchant/auction',
    method: 'post',
    data: data
  })
}

// 修改拍卖
export function updateAuction(data) {
  return request({
    url: '/merchant/auction',
    method: 'put',
    data: data
  })
}

// 删除拍卖
export function deleteAuction(id) {
  return request({
    url: '/merchant/auction/' + id,
    method: 'delete'
  })
}

// 开始拍卖
export function startAuction(id) {
  return request({
    url: '/merchant/auction/start/' + id,
    method: 'put'
  })
}

// 结束拍卖
export function endAuction(id) {
  return request({
    url: '/merchant/auction/end/' + id,
    method: 'put'
  })
}

// 取消拍卖
export function cancelAuction(id) {
  return request({
    url: '/merchant/auction/cancel/' + id,
    method: 'put'
  })
}

// 查询竞拍记录
export function getAuctionRecordList(query) {
  return request({
    url: '/merchant/auction/record/list',
    method: 'get',
    params: query
  })
} 